package org.blogwu.learn.jvmlearn.class1.class19;

public class MyCat {

    public MyCat() {
        System.out.println("2 MyCat is loader by:" + this.getClass().getClassLoader());


        //当在claspath中删除MySample类时,此代码会报错 (NoClassDefFoundError),因为MyCat是由应用类加载器来加载的,而MySample是由自定义加载器来加载的.
        //当MyCat获取MySample的class时候,在命名空间中找不到MySample,所以: java.lang.NoClassDefFoundError
//        System.out.println("3 MyCat are parent:"+MySample.class);
    }

}
